package com.huikeportal.service;

import java.util.concurrent.TimeoutException;
//import net.rubyeye.xmemcached.exception.MemcachedException;

public interface MemcachedService {
	
	/**
	 * 保存缓存
	 * @return boolean
	 * @throws MemcachedException 
	 * @throws InterruptedException 
	 * @throws TimeoutException 
	 * 
	 */
	public boolean setMemcached(String key,Object object);
	/**
	 * 根据key取缓存
	 * @param String key
	 * @return Object
	 * @throws TimeoutException
	 * @throws InterruptedException
	 * @throws MemcachedException
	 */
	
	public Object getMemcached(String key);
	/**
	 * 根据key修改缓存
	 * @param key
	 * @param object
	 * @return
	 * @throws TimeoutException
	 * @throws InterruptedException
	 * @throws MemcachedException
	 */
	public boolean replaceMemcached(String key,Object object);
	/**
	 * 根据key移除缓存
	 * @param key
	 * @return
	 * @throws TimeoutException
	 * @throws InterruptedException
	 * @throws MemcachedException
	 */
	
	
	/** 
	 * getKey值
	 * @param method 
	 * @param assignCacheKey 
	 * @return 
	 * @throws IllegalArgumentException 
	 */ 
	public String getCacheKey(Object[] args, String cacheKeyExpression) throws NoSuchMethodException, IllegalArgumentException ;

}
